package com.zhaolaobao.redis.queue.core;

import com.zhaolaobao.redis.service.RedisService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @ClassName RedisQueueTemplate
 * @Description //
 * @Author WHX
 * @Date 2021/10/29 13:17
 **/
@Component
public class RedisQueueTemplate {

    @Resource
    private RedisService redisService;

    /**
     * 发送延时队列
     * @param queueName  队列名
     * @param obj        消息内容
     * @param milliseconds 到期时间
     */
     public void sendDelayQueue(String queueName, Object obj, long milliseconds){
         redisService.zsAdd(queueName, obj, milliseconds);
     }

}
